from utils import send_message, send_message_calc_avg, send_message_val, send_message_val_single, send_message_val_long
import time
from tabulate import tabulate

user_id_map = {"王良栋" : "758268aa",
                "谷舒豪": "dfg9ca3e",
                "李季杰": "gb8bgd55",
                "项文": "g8b45d2g",
                "严照东": "9gdf9d4e",
                "刘广": "2dc93b7c",
                "张正":"eg33be59"}

checked_models = ['Aquila3-1.8B-moe']
#checked_models = ['Aquila-30B-reinit-knowledge-validation']
is_test = False

# "/share/project/64node-bmt-flashatten/rank0.log",
prev_iters = {model:-1 for model in checked_models}
while True:
    checked_model = send_message_calc_avg(model_name='Aquila3-1.8B-moe', 
            wandb_link="https://wandb.ai/aquila3/aquila_1.8b_k65?workspace=user-aquila3", operation_link="https://jwolpxeehx.feishu.cn/docx/NBYidQ7CNoWHSHxNZzjcIAe0nZm",
                    checked_models=checked_models, user_id=user_id_map["谷舒豪"], remote_volume="/share/project/aquila3/FlagScale/outputs/logs/host_29_172.24.19.184.output",
                    is_test=is_test)
    checked_model = send_message_calc_avg(model_name='Aquila3-1.8B-moe',
            wandb_link="https://wandb.ai/aquila3/aquila_1.8b_k65?workspace=user-aquila3", operation_link="https://jwolpxeehx.feishu.cn/docx/NBYidQ7CNoWHSHxNZzjcIAe0nZm",
                    checked_models=checked_models, user_id=user_id_map["李季杰"], remote_volume="/share/project/aquila3/FlagScale/outputs/logs/host_29_172.24.19.184.output",
                    is_test=is_test)
    #checked_model = send_message_val_long(model_name='Aquila-30B-reinit-knowledge-validation', 
    #                           checked_models=checked_models, user_id=user_id_map["李季杰"],
    #                           wandb_link="https://wandb.ai/jjli/Aquila-7b-64n8g/runs/cjdskxnr?workspace=user-jjli",
    #                           local_volume="/share/project/lijijie/flagai-internal-gpm_dev2-2-newcode/examples/aquila/infer/logs/",
    #                           filenames=["wiki.loss.log","all.loss.log","11_mmlu.loss.log","sft.loss.log","12_code.loss.log"],
    #                           is_test=is_test,num_lines=3)


    if not checked_models:
        break
    time.sleep(1750)
